package com.dhl.decorated.mydecorated;

import com.dhl.decorated.Drink;

/**
 * @title: Decorate
 * @Author danghailiang
 * @Date: 2022/8/3 21:50
 * @Version 1.0
 */
public class Decorate extends Drink {
    private Drink drink;

    public Decorate(Drink drink) {
        this.drink = drink;
    }

    @Override
    public float cost() {
        return drink.cost() + super.getPrice();// 自己的价格
    }

    @Override
    public String getDes() {
        return super.getDes() + ", " + this.getPrice() + " && " + drink.getDes();
    }
}
